# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=storm-ring
pkgver=0.1
pkgrel=7
groups=('blackarch' 'blackarch-voip' 'blackarch-scanner')
pkgdesc='This simple tool is useful to test a PABX with "allow guest" parameter set to "yes" (in this scenario an anonymous caller could place a call).'
arch=('any')
url='http://packetstormsecurity.com/files/115852/Storm-Ringing-PABX-Test-Tool.html'
license=('custom:unknown')
depends=('python2')
source=("https://dl.packetstormsecurity.net/sip/$pkgname.tar.gz")
sha512sums=('eee28083398636fc2121b5c5f21a7ed7b78ddfc7c49ef4576ad76f9fac04f041bfd7b6bd06dd584ffb32168beabf482369f48c2755587b565b5b5dcdfe16ec7a')

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README

  rm README

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec python2 /usr/share/$pkgname/$pkgname.py "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

